<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>
            X-admin v1.0
        </title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="__PUBLIC__/Admin/css/x-admin.css" media="all">
    </head>
    <body>
        <div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>会员管理</cite></a>
              <a><cite>基本设置</cite></a>
            </span>
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
        </div>
        <div class="x-body">
            <div id="box" style="width: 100%;height:400px;"></div> 
        </div>
        <script src="__PUBLIC__/Admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="__PUBLIC__/Admin//js/x-layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="//cdn.bootcss.com/jquery/3.1.1/jquery.min.js"></script>
        <script type="text/javascript" src="//cdn.bootcss.com/echarts/3.3.2/echarts.min.js"></script>
        <script type="text/javascript">
             // 基于准备好的dom，初始化echarts实例
            var myChart = echarts.init(document.getElementById('box'));

            xdata = [];
            ydata = [];

            $.ajax({
                url: '{:U('admin/count/reg')}',
                type: 'GET',
                async: false,
                dataType: 'json'
            })
            .done(function(data) {
                for (var i in data) {
                    ydata.push(data[i].cn);
                    xdata.push(data[i].cdate);

                };
                 alert(ydata);
            })
            .fail(function() {
                
            })

            // 指定图表的配置项和数据
            var option = {
                title: {
                    text: '用户注册量'
                },
                tooltip: {},
                legend: {
                    data:['个数']
                },
                xAxis: {
                    data: xdata
                },
                yAxis: {},
                series: [{
                    name: '个数',
                    type: 'bar',
                    data: ydata
                }]
            };


            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);

        </script>
        <script>
            layui.use(['element','layer','form'], function(){
                $ = layui.jquery;//jquery
              lement = layui.element();//面包导航
              layer = layui.layer;//弹出层
              form = layui.form()
            

              
             //监听提交
              form.on('submit(*)', function(data){
                console.log(data);
                //发异步，把数据提交给php
                layer.alert("保存成功", {icon: 6});
                return false;
              });

              })
            </script>
            <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
        </script>
    </body>
</html>